﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaciejGrabek.WP7.Services.Model.Entities;

namespace MaciejGrabek.WP7.Services.Model.Mappers
{
    public static class GameResultLightMapper
    {
        public  static GameResultLightDto ToDto(GameResultsLightView item)
        {
            return new GameResultLightDto()
                       {
                           OrderNumber = item.Id.Value,
                           PlayerName = item.PlayerName,
                           DateTimeString = item.DateTime.ToString("yyyy-MM-dd HH:mm"),
                           Score = item.Score
                       };
        }

        public static IEnumerable<GameResultLightDto> ToDto(IEnumerable<GameResultsLightView> items)
        {
            return items.Select(item => ToDto(item));
        }
    }
}